package com.example.charge.model

import com.example.charge.api.ChargeApiService
import com.example.net.RetrofitUtils
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Qualifier
import javax.inject.Singleton

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class Charge{

}
@Module
@InstallIn(SingletonComponent::class)
object ChargeWorkModel {
    @Charge
    @Provides
    @Singleton
    fun provideRetrofit():Retrofit{
        return RetrofitUtils.getRetrofit()
    }
    @Provides
    @Singleton
    fun provideCarService(@Charge retrofit: Retrofit):ChargeApiService{
        return retrofit.create(ChargeApiService::class.java)
    }
}